
def hanoi(n, source, dest, temp):
    if n == 1:
        print(f"Move disk 1 from {source} to {dest}")
        return
    hanoi(n-1, source, temp, dest)
    print(f"Move disk {n} from {source} to {dest}")
    hanoi(n-1, temp, dest, source)

n = int(input("Enter the number of disks: "))
print(f"Tower of Hanoi: \nMove {n} from A to C using B as temp")
hanoi(n, "A", "C", "B")